﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QD.SyncServers
{
    public partial class SyncStep2 : BaseFrm
    {
        public SyncStep2()
        {
            InitializeComponent();
        }

        private void SyncStep2_Load(object sender, EventArgs e)
        {
            this.label1.Text = "请选择系统备路径，注意该路径为服务器上路径";

            this.txtBackupPath.Text = "D:\\QDV4SysnUp";
        }

        private void btnPrev_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form frm = Application.OpenForms["SyncStep1"];
            if (frm == null)
            {
                frm = new SyncStep1();
                frm.ShowDialog();
            }
            else {
                frm.Show();
            }
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            ConfigInstanceHelper.ConfigInstance.BackupTargetDB = true;
            ConfigInstanceHelper.ConfigInstance.BackupPath = this.txtBackupPath.Text;

            this.Hide();
            Form frm = Application.OpenForms["SyncStep3"];
            if (frm == null)
            {
                frm = new SyncStep3();
                frm.ShowDialog();
            }
            else
            {
                frm.Show();
            }
        }

        private void SyncStep2_Shown(object sender, EventArgs e)
        {
            this.btnNext.Focus();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ConfigInstanceHelper.ConfigInstance.BackupTargetDB = true;
            ConfigInstanceHelper.ConfigInstance.BackupPath = this.txtBackupPath.Text;
        }
    }
}
